import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import 'vant/es/toast/style'
import 'vant/es/dialog/style'
import 'vant/es/field/style'
import 'vant/es/loading/style'
import 'vant/es/popup/style'
import 'vant/es/picker/style'
import 'vant/es/skeleton/style'

import router from './router'
import { installApprovalsBackToHome } from '@/utils/navigation'

// 创建应用实例
const app = createApp(App)
const pinia = createPinia()

// 使用路由和状态管理
app.use(router)
app.use(pinia)

// 注册全局导航规则：从 /approvals 的后退统一回到首页 /home
installApprovalsBackToHome(router)

app.mount('#app')
